package lib

import (
	"runtime"
)

func Bf(ch chan *Pageitem, process int) chan int {
	runtime.GOMAXPROCS(runtime.NumCPU())
	rs := make(chan int)

	for i := 0; i < process; i++ {
		go func() {
			for item := range ch {
				Mkdir(Basedir + item.Filename)
				Downlaod(item.Img, item.Filename)
				down(item.FitUrl, item.Filename)
			}
			rs <- 0
		}()
	}
	return rs
}
func down(url, filename string) {
	durl := Search_chinaz(url)
	Downlaod(durl, filename)
}
